<?php
/*clean up session*/
session_start();
include('connect_db.php');
//update last login time
$query = "UPDATE users
	SET last_login = now()
	WHERE id = ".$_SESSION['id'];
mysql_query($query);

unset($_SESSION['loggedin']);
unset($_SESSION['id']);
unset($_SESSION['lastname']);
unset($_SESSION['firstname']);
unset($_SESSION['username']);
unset($_SESSION['privilege']);
session_destroy();

header('Location: index.php');
?>